﻿<%@ Page Title="" Language="C#" MasterPageFile="my-account.master" AutoEventWireup="true"
    CodeBehind="posts-history.aspx.cs" Inherits="SocialShare.Web.My_Account.posts_history" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link href="../App_Style/CSS/grid.css" rel="stylesheet" type="text/css" />
    <section class="grid_12 margin-bottom-double alpha">
  <section class="grid_12 title-regular">
            My Blog Posts
            <hr />
        </section>
         <section class="grid_12 alpha">
    <asp:GridView ID="grvBlogPosts" runat="server" Width="100%"
        AutoGenerateColumns="False" CssClass="GridView" AllowPaging="true" PageSize="15"
        DataSourceID="ObjectDataSource1">
        <AlternatingRowStyle CssClass="AlternatingRowStyle" />
    <FooterStyle CssClass="FooterStyle" />
    <HeaderStyle CssClass="HeaderStyle" />
    <PagerStyle CssClass="PagerStyle" />
    <RowStyle CssClass="RowStyle" />
    <SelectedRowStyle CssClass="SelectedRowStyle" />
    <SortedAscendingHeaderStyle CssClass="sortasc-header" />
    <SortedDescendingHeaderStyle CssClass="sortdesc-header" />
    <SortedAscendingCellStyle CssClass="sortasc-row" />
    <SortedDescendingCellStyle CssClass="sortdesc-row" />
    <PagerSettings Mode="NumericFirstLast" PageButtonCount="7" FirstPageText="«" LastPageText="»" />    
    <EditRowStyle />
    <EmptyDataRowStyle />
    <EmptyDataTemplate>
        <div class="notice">
            Sorry, no data available.
         </div>
    </EmptyDataTemplate>
        <Columns>
            <asp:BoundField DataField="BlogId" HeaderText="BlogId" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%"
                SortExpression="BlogId" />
              
                    <asp:TemplateField HeaderText="Post Title" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                     <a href='<%# Utilities.SiteSettings.BaseUrl+"blogs/"+Eval("BlogName")+"/"+Eval("BlogId")+"-"+Imgalib.Utility.StringFormatter.CreateCleanUrl(Eval("PostTitle").ToString(),"aspx") %>'
                    class="forum-post-list-item-title clearfix">
                    <%# Eval("PostTitle")%>
                </a>
                    
                    </ItemTemplate>
                    </asp:TemplateField>
             
                  <asp:TemplateField HeaderText="Create Date" HeaderStyle-HorizontalAlign="Left">
                <ItemTemplate>
                <%# String.Format("{0:dd-mm-yyyy}", Eval("DateCreated"))%>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" Width="20%" />
                </asp:TemplateField>

            <asp:BoundField DataField="PostStatus" HeaderText="Status" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%"
                SortExpression="PostStatus" />
        </Columns>
        
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        OldValuesParameterFormatString="original_{0}"  SelectCountMethod="GetTotalCountActiveBlogPostsByMember"
        SelectMethod="GetAllActiveBlogPostsByMember"  StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows" EnablePaging="true"
        TypeName="SocialShare.DAL.Facades.BlogFacade">
        <SelectParameters>
            <asp:Parameter Name="startRowIndex" Type="Int32" />
            <asp:Parameter Name="maximumRows" Type="Int32" />
            <asp:SessionParameter Name="blogName" SessionField="_BlogName" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </section>
    </section>
    <section class="grid_12 margin-bottom-double alpha">
      <section class="grid_12 title-regular">
            My Forum Posts
            <hr />
        </section>
         <section class="grid_12 alpha">
    <asp:GridView ID="grvPosts" runat="server" AllowPaging="True"  CssClass="GridView"
        AutoGenerateColumns="False" DataSourceID="ObjectDataSource2" Width="100%" PageSize="15">
       <AlternatingRowStyle CssClass="AlternatingRowStyle" />
    <FooterStyle CssClass="FooterStyle" />
    <HeaderStyle CssClass="HeaderStyle" />
    <PagerStyle CssClass="PagerStyle" />
    <RowStyle CssClass="RowStyle" />
    <SelectedRowStyle CssClass="SelectedRowStyle" />
    <SortedAscendingHeaderStyle CssClass="sortasc-header" />
    <SortedDescendingHeaderStyle CssClass="sortdesc-header" />
    <SortedAscendingCellStyle CssClass="sortasc-row" />
    <SortedDescendingCellStyle CssClass="sortdesc-row" />
    <PagerSettings Mode="NumericFirstLast" PageButtonCount="7" FirstPageText="«" LastPageText="»" />    
    <EditRowStyle />
    <EmptyDataRowStyle />
    <EmptyDataTemplate>
        <div class="notice">
            Sorry, no data available.
         </div>
    </EmptyDataTemplate>
        <Columns>
           <asp:BoundField DataField="PostId" HeaderText="Id#" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%"
                SortExpression="PostId" />
                <asp:TemplateField HeaderText="Create Date" HeaderStyle-HorizontalAlign="Left">
                <ItemTemplate>
                <%# String.Format("{0:dd-mm-yyyy}",Eval("CreateDate")) %>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" Width="20%" />
                </asp:TemplateField>
                        <asp:TemplateField HeaderText="Post Title" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
                <ItemTemplate>
                
                 <a href='<%# Utilities.SiteSettings.BaseUrl+"discussion-board/"+Eval("PostId")+"-"+Imgalib.Utility.StringFormatter.CreateCleanUrl(Eval("MessageSubject").ToString(),"aspx") %>'
                    class="forum-post-list-item-title clearfix">
                    <%#  Eval("MessageSubject")%>
                    </a>
                </ItemTemplate>
                </asp:TemplateField>

         
            <asp:BoundField DataField="CategoryName" HeaderText="Category Name" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"
                SortExpression="CategoryName" ItemStyle-Width="20%" />
            <asp:BoundField DataField="TotalReply" HeaderText="Total Reply" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                SortExpression="TotalReply" ItemStyle-Width="10%" />
           
            <asp:BoundField DataField="StatusName" HeaderText="Status" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" SortExpression="StatusName" ItemStyle-Width="10%" />
        </Columns>
       
    </asp:GridView>

    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
        OldValuesParameterFormatString="original_{0}"  SelectCountMethod="GetTotalCountAllPostsByMember"
        SelectMethod="GetAllPostsByMember" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows" EnablePaging="true"
        TypeName="SocialShare.DAL.Facades.ForumFacade">
        <SelectParameters>
            <asp:Parameter Name="startRowIndex" Type="Int32" />
            <asp:Parameter Name="maximumRows" Type="Int32" />
            <asp:SessionParameter Name="UserID" SessionField="LOGGED_IN_USER_ID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
     </section>
    </section>
</asp:Content>
